package com.atstudent.gmall.common.feign.search;

import com.atstudent.gmall.common.result.Result;
import com.atstudent.gmall.search.dto.SearchParamDTO;
import com.atstudent.gmall.search.entity.Goods;
import com.atstudent.gmall.search.vo.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 薛有朋
 * @CreatDate 2025/3/14 19:10
 **/
@FeignClient(value = "service-search")
public interface SearchFeignClient {

    @PostMapping(value = "/api/inner/search/saveGoods")
    public Result saveGoods(@RequestBody Goods goods);

    @DeleteMapping(value = "/api/inner/search/deleteGoods/{id}")
    public Result deleteGoods(@PathVariable(value = "id") Long skuId);

    @PostMapping(value = "/api/inner/search/search")
    public Result<SearchResponseVo> search(@RequestBody SearchParamDTO searchParamDTO);

    @PutMapping(value = "/api/inner/search/updateHotScore/{skuId}/{hotScore}")
    public Result updateHotScore(
            @PathVariable(value = "skuId") Long skuId ,
            @PathVariable(value = "hotScore") Long hotScore);
}
